/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.sales.hanserver.action.hancadso.purchaserequest;

import static br.com.sales.hanserver.action.hancadso.purchaserequest.consts.HanCadSOServerConsts.INACTIVATE;
import br.com.sales.hanserver.dao.Dao;
import static br.com.sales.hanserver.dao.Dao.closeConn;
import static br.com.sales.hanserver.dao.Dao.getConn;
import java.sql.PreparedStatement;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author v
 */
public class InactivateRequestAction extends Dao {

    public InactivateRequestAction() {
    }

    public void inactivate(long sequence) {
        try {

            PreparedStatement preparedStmt = getConn().prepareStatement(INACTIVATE);
            preparedStmt.setLong(1, sequence);

            preparedStmt.execute();

        } catch (Exception e) {
            Logger.getLogger(InactivateRequestAction.class.getName()).log(Level.SEVERE, "Error inativate", e);
        } finally {
            closeConn();
        }
    }

}
